# 购物单价 * 数量  = 交易金额
products = []  # 购买商品列表
money = float(input("请输入商品单价："))
number = int(input("请输入购买数量："))
while True:
    print("""
        菜单列表
        1、计算当前商品总价
        2、计算当前商品折扣后的总价
        3、输出商品列表内容
        4、输入q 或 Q退出程序
    """)
    key = input("请输入操作：")
    if key == "1":
        print(f"当前购买的商品交易原价是：{money * number}")
        rs = money * number
        products.append(rs)
    elif key == "2":
        feast = input("请输入当前节日名称（如：中秋、国庆、重阳、春节、清明）：")
        if feast == "中秋":
            discount = 0.5
        elif feast == "国庆":
            discount = 0.3
        elif feast == "重阳":
            discount = 0.8
        elif feast == "春节":
            discount = 0.6
        elif feast == "清明":
            discount = 0.9
        else:
            discount = 1
        print(f"当前购买的商品交易原价是：{money * number * discount}")
        rs = money * number * discount
        products.append(rs)
    elif key == "3":
        print(products)
    elif key == "q" or key == "Q":
        exit()
    else:
        continue
